public class Work01 {
    private static int[] date = new int[25];
    private static int count = 0;


    static int fib(int n){
        //记录次数
        count++;
        if(n == 1 || n ==2){
            return date[n];
        }
        if(date[n] != 0){
            return date[n];
        }
        date[n] = fib(n-1) + fib(n -2);
        return date[n];
    }

    public static void main(String[] args) {
        //递归记忆化
        date[1] = 1;
        date[2] = 1;
        int fib = fib(17);
        System.out.println(fib);
        System.out.println(count);

    }
}
